package com.jdk.study.d2jvm.chapter05;

/**
 * @description: 虚方法表的举例
 * @author: JackLi
 * @date: 2020/4/13 17:40
 */
public class Stack12_VirtualMethodTable {
}

interface Friendly {
    void sayHello();
    void sayGoodbye();
}

class Dog1 {
    public void sayHello() {
    }

    public String toString() {
        return "Dog1";
    }
}

class Cat1 implements Friendly {
    public void eat() {
    }

    @Override
    public void sayHello() {
    }

    @Override
    public void sayGoodbye() {
    }

    protected void finalize() {
    }
}

class CockerSpaniel extends Dog1 implements Friendly {
    @Override
    public void sayHello() {
        super.sayHello();
    }

    @Override
    public void sayGoodbye() {
    }
}
